#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm,x=0,y=0,xe=-8,ye=-4,dx,dy,p,i;
initgraph(&gd,&gm,"C:\\Turboc3\\BGI");
putpixel(x,y,YELLOW);
dx=-(xe-x);
dy=-(ye-y);
p=(2*dx)-(2*dy);
for(i=0;i<=dy;i++)
{
if(p<0)
{
putpixel(x+1,y,YELLOW);
p=p+(2*dy);
}
else
{
putpixel(x+1,y+1,YELLOW);
p=p+(2*dy)-(2*dx);
}
}
getch();
closegraph();
}